import React, { Component } from 'react';
class App extends Component {
  constructor() {
    super();
    this.btnRef = React.createRef();
  }
  handleClick = () => {
    console.dir(this.btnRef);
  };
  render() {
    return (
      <div>
        <div>
          <h1 onClick={this.handleClick} >点我就有了</h1>
        </div>
        <MyVideo ref={ref => this.btnRef = ref} ></MyVideo>
      </div>
    );
  }
}

const MyVideo = React.forwardRef((props, ref) => {
  return <div>
    <video ref={ref}></video>
  </div>;
});

export default App;